import time

import util.PATH as PATH
from baseline.LDA_SVM import svm_main as SVM_main
from baseline.LDA_KL import main as KL_main
from baseline.DERTOM import main as DERTOM_main
import util.data_helper as data_helper

if __name__ == '__main__':

	bug_msg_all, _ = data_helper.get_msg_all()
	vocabulary = data_helper.create_vocabulary()
	developers_list = data_helper.create_developers_list()
	time_windows = data_helper.split_dataset_by_eight_to_two(bug_msg_all)   # 存放的是id

	names = ['Eclipse', 'GCC', 'Mozilla', 'Netbeans', 'OpenOffice']
	path = PATH.root
	name = PATH.root.split('/')[-2]

	T = 300             # 这俩参数写在这儿是为了使"程序入口"这个概念更加名副其实, 方便调节
	n_iteration = 200
	# parser = argparse.ArgumentParser()
	# parser.add_argument('index', help='指定数据集的索引')
	# args = parser.parse_args()
	# index = int(args.index)


	start_time = time.clock()
	print('数据集:{}'.format(name))
	SVM_main(name, path, T, n_iteration, time_windows[0], time_windows[1])
	print('花费时间: {}'.format(time.clock() - start_time))